package com.litemall.order.service.impl;

import com.litemall.order.mapper.OrderMapper;
import com.litemall.order.pojo.Order;
import com.litemall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author : Areli
 * @date : 2020/4/20 9:28
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrderMapper orderMapper;

    @Override
    public List<Order> findOrderByUserName(String username) {
        Example example = new Example(Order.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("username",username);
        List<Order> orderList = orderMapper.selectByExample(example);
        return orderList;
    }
}
